//该路由处理函数用获取用户信息
const express = require('express')
//创建路由实例
const router = express.Router()
//导入处理函数模块
const userinfo_handler = require('../router_handler/userinfo')

//导入验证规则中间件
const expressJoi = require('@escook/express-joi');
//通过解构
const {update_userinfo_schema,update_userPwd_schema, update_avater_shema} = require('../schema/user'); 
router.get('/userinfo',userinfo_handler.getUserInfo);
//更新用户信息路由
router.post('/userinfo',expressJoi(update_userinfo_schema),userinfo_handler.updateUserInfo)
//更新密码路由
router.post('/updatePwd',expressJoi(update_userPwd_schema),userinfo_handler.updatePwd);
//定义更新头像的路由
router.post('/update/avater',expressJoi(update_avater_shema),userinfo_handler.updateAvater)
//将实例对象暴露出去
module.exports=router;